﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _02_Button按钮
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 绑定按钮点击事件
        /// </summary>
        /// <param name="sender">虽然是object但是当中存储的是对象（点击的对象）</param>
        /// <param name="e">点击的时候附带的数据</param>
        private void button3_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;
            //提示罗老师上午好
            MessageBox.Show(btn .Text + "，上午好");
        }
        /// <summary>
        /// 绑定事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            this.button3.Click += new System.EventHandler(this.button3_Click);
            this.button4.Click += new System.EventHandler(this.button3_Click);
            this.button5.Click += new System.EventHandler(this.button3_Click);
        }
        /// <summary>
        /// 解绑事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            this.button3.Click -= new System.EventHandler(this.button3_Click);
            this.button4.Click -= new System.EventHandler(this.button3_Click);
            this.button5.Click -= new System.EventHandler(this.button3_Click);
        }
        /// <summary>
        /// 第一步
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button6_Click(object sender, EventArgs e)
        {
            this.button6.Enabled = false;
            this.button7.Enabled = true;
        }
        /// <summary>
        /// 第二步
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button7_Click(object sender, EventArgs e)
        {
            this.button7.Enabled = false;
            this.button8.Enabled = true;
        }
        /// <summary>
        /// 第三步
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button8_Click(object sender, EventArgs e)
        {
            this.button8.Enabled = false;
            this.button9.Enabled = true;
        }
        /// <summary>
        /// 第四步
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button9_Click(object sender, EventArgs e)
        {
            this.button9.Enabled = false;
            this.button10.Enabled = true;
        }
        /// <summary>
        /// 第五步
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button10_Click(object sender, EventArgs e)
        {
            this.button10.Enabled = false;
            this.button6.Enabled = true;
        }

        /// <summary>
        /// 第一个按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button11_Click(object sender, EventArgs e)
        {
            this.button11.Visible = false;
            this.button12.Visible = true;
        }

        /// <summary>
        /// 第二个按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button12_Click(object sender, EventArgs e)
        {
            this.button12.Visible = false;
            this.button13.Visible = true;
        }
        /// <summary>
        /// 第三步
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button13_Click(object sender, EventArgs e)
        {
            this.button13.Visible = false;
            this.button14.Visible = true;
        }
        /// <summary>
        /// 第四步
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button14_Click(object sender, EventArgs e)
        {
            this.button14.Visible = false;
            this.button15.Visible = true;
        }
        /// <summary>
        /// 第五步
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button15_Click(object sender, EventArgs e)
        {
            this.button15.Visible = false;
            this.button11.Visible = true;
        }
        /// <summary>
        /// 启动/停止
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button16_Click(object sender, EventArgs e)
        {
            if (this.button16.Text == "启 动")
            {
                this.button16.Text = "停 止";
                this.button16.BackColor = Color.Red;
                this.button16.Image = global::_02_Button按钮.Properties.Resources._24gf_stop;
            }
            else
            {
                this.button16.Text = "启 动";
                this.button16.BackColor = Color.SeaGreen;
                this.button16.Image = global::_02_Button按钮.Properties.Resources.启动__2_;
            }
        }
        /// <summary>
        /// 前
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button17_Click(object sender, EventArgs e)
        {
            this.button21.Location = new Point(this.button21.Location.X, this.button21.Location.Y - 10);
        }
        /// <summary>
        /// 后
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button18_Click(object sender, EventArgs e)
        {
            this.button21.Location = new Point(this.button21.Location.X, this.button21.Location.Y + 10);
        }
    }
}
